package com.coollang.smartbra.beans;

import android.os.Parcel;
import android.os.Parcelable;

import com.chad.library.adapter.base.entity.MultiItemEntity;

/**
 * @author: Timmy
 * @data: 2017/12/15
 * @Fuction:
 */
public class NewActionData implements MultiItemEntity, Parcelable {

    public static final int ACTION_CORRECT_FLAG = 1;
    public static final int ACTION_ERROR_FLAG = 2;

    private int actionType;
    private int actionFlag;
    private int errorType;
    private int heartRate;
    private int time;
    private long startTime;

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getActionType() {
        return actionType;
    }

    public void setActionType(int actionType) {
        this.actionType = actionType;
    }

    public int getActionFlag() {
        return actionFlag;
    }

    public void setActionFlag(int actionFlag) {
        this.actionFlag = actionFlag;
    }

    public int getErrorType() {
        return errorType;
    }

    public void setErrorType(int errorType) {
        this.errorType = errorType;
    }

    public int getHeartRate() {
        return heartRate;
    }

    public void setHeartRate(int heartRate) {
        this.heartRate = heartRate;
    }

    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    @Override
    public int getItemType() {
        return actionFlag;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.actionType);
        dest.writeInt(this.actionFlag);
        dest.writeInt(this.errorType);
        dest.writeInt(this.heartRate);
        dest.writeInt(this.time);
        dest.writeLong(this.startTime);
    }

    public NewActionData() {
    }

    protected NewActionData(Parcel in) {
        this.actionType = in.readInt();
        this.actionFlag = in.readInt();
        this.errorType = in.readInt();
        this.heartRate = in.readInt();
        this.time = in.readInt();
        this.startTime = in.readLong();
    }

    public static final Parcelable.Creator<NewActionData> CREATOR = new Parcelable.Creator<NewActionData>() {
        @Override
        public NewActionData createFromParcel(Parcel source) {
            return new NewActionData(source);
        }

        @Override
        public NewActionData[] newArray(int size) {
            return new NewActionData[size];
        }
    };
}
